package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysMaster;
import com.ruoyi.system.service.ISysMasterService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 站长信息Controller
 *
 * @author ruoyi
 * @date 2022-07-27
 */
@RestController
@RequestMapping("/system/master")
public class SysMasterController extends BaseController
{
    @Autowired
    private ISysMasterService sysMasterService;


    /**
     * 获取站长信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:master:query')")
    @GetMapping(value = "/")
    public AjaxResult getInfo()
    {
        return AjaxResult.success(sysMasterService.selectSysMaster());
    }



    /**
     * 修改站长信息
     */
    @PreAuthorize("@ss.hasPermi('system:master:edit')")
    @Log(title = "站长信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysMaster sysMaster)
    {
        return toAjax(sysMasterService.updateSysMaster(sysMaster));
    }


}
